package wsi.depend.model;

import org.rygh.core.face.IHasName;
import org.rygh.core.model.common.Pair;
import org.rygh.core.xml.XmlPath;
import org.rygh.semantic.model.rdf.Predicate;

import wsi.function.Function;

public class Dependency extends Pair<Function, Function> implements IHasName {

	protected XmlPath xpath;
	protected Predicate predicate;

	/**
	 * dependant is depend on provider
	 * 
	 * @param dependant
	 * @param provider
	 */
	public Dependency(Function dependant, Function provider) {
		super(dependant, provider);
	}

	public Function getDependant() {
		return getLeft();
	}

	@Override
	public String getName() {
		return xpath.getValue();
	}

	public Predicate getPredicate() {
		return predicate;
	}

	public Function getProvider() {
		return getRight();
	}

	public XmlPath getXpath() {
		return xpath;
	}

	public void setPredicate(Predicate predicate) {
		this.predicate = predicate;
	}

	public void setXpath(XmlPath xpath) {
		this.xpath = xpath;
	}

}
